<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhotoList.ascx.cs" Inherits="IGlobalist.Cms.Admin.Control.PhotoList" %>

<asp:Label ID="Label1" runat="server" Text="View "></asp:Label>
<asp:DropDownList ID="ddlView" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlView_SelectedIndexChanged">
</asp:DropDownList>
<br /><br />
<div>
  <fieldset id="fsMain" runat="server">
    <legend><asp:Label ID="lbMain"  runat="server"  Text="Photo list"></asp:Label> </legend> 
<asp:Panel ID="pnlList" runat="server" >
    <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvList_RowDataBound" OnRowCommand="gvList_RowCommand" >
        <Columns>
        
        <asp:TemplateField HeaderText="Image ">
            <ItemTemplate>
                <asp:Image ID="imgPhoto" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Name ">
            <ItemTemplate>
                <asp:Label ID="lblName" runat="server" Text='<% # DataBinder.Eval(Container,"DataItem.Name") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
       
        <asp:TemplateField HeaderText="Description">
            <ItemTemplate>
                <asp:Label ID="lblQty" runat="server" Text='<% # DataBinder.Eval(Container,"DataItem.Description") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Action">
            <ItemTemplate>
                <asp:ImageButton ID="imgEdit" ImageUrl="~/Admin/Images/edit.gif"  runat="server" CommandName="editPhoto" CommandArgument='<% # DataBinder.Eval(Container,"DataItem.ID") %>' />
               <asp:ImageButton ID="ingDelete" ImageUrl="~/Admin/Images/delete.gif" runat="server" CommandName="delPhoto" CommandArgument='<% # DataBinder.Eval(Container,"DataItem.ID") %>' OnClientClick="return confirm('Are you sure you want to delete?');" />
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        
        </Columns>
    </asp:GridView>
</asp:Panel>


<asp:Panel ID="pnlThumbnail" runat="server"  Visible="false">

    <asp:DataList ID="dlThubnail" runat="server" RepeatDirection="Horizontal" RepeatColumns="6" OnItemDataBound="dlThubnail_ItemDataBound" OnItemCommand="dlThubnail_ItemCommand" >
    <ItemTemplate>
           <table>
            <tr>
               <td valign="top"> <asp:Image ID="imgPhoto" runat="server" /></td>
            </tr>
            <tr><td style="width:100px;"><asp:Label ID="lblName" runat="server" Text='<% # DataBinder.Eval(Container,"DataItem.Name") %>'></asp:Label></td></tr>
             <tr><td> 
                <asp:ImageButton ID="imgEdit" ImageUrl="~/Admin/Images/edit.gif"  runat="server" CommandName="editPhoto" CommandArgument='<% # DataBinder.Eval(Container,"DataItem.ID") %>' />
               <asp:ImageButton ID="ingDelete" ImageUrl="~/Admin/Images/delete.gif" runat="server" CommandName="delPhoto" CommandArgument='<% # DataBinder.Eval(Container,"DataItem.ID") %>' OnClientClick="return confirm('Are you sure you want to delete?');" /></td></tr>
           </table>     
        
    </ItemTemplate>    
    
</asp:DataList>
</asp:Panel>
</fieldset>
</div>
